<?php
if( ismedia() ):
	include "msingle.php";
else:
?>
	<div id="content">
		<div id="article">
<?php while(have_posts()): the_post()?>
			<h2 class="entry-title"><?php the_title()?></h2>

<header>
	<span class="icon-user"><a href="<?php echo get_author_posts_url( $authordata->ID )?>">&nbsp;<?php the_author('nickname')?></a></span>
	<span class="icon-time">&nbsp;<?php the_time('Y年m月d日')?></span>
	<span class="icon-cmt"><a href="<?php the_permalink()?>#comments"><?php echo get_post($post->ID)->comment_count?></a></span>
	<?php if(get('ini_rate')) fancyratings()?> 
	<?php if( i_tags()&&get('ini_mtag') ) echo "<p>标签：".i_tags()."</p>\n"?>
</header>

<?php if( get('ini_ad3') && get('ini_mad') ) echo "<div class=\"ad3\">".get('ini_ad3_code')."</div>\n";
if( !(ini_count($text))==0 ){    #判断是否有文字
	echo '<div class="excerpt hide">';
	ini_excerpt(150);
	echo "</div>\n";
}?>
			<div class="context"><?php the_content()?></div>
		</div><?#end article?>
<?php wp_link_pages( array('before'=>'<div id="nextpage">', 'after'=>'</div>','next_or_number'=>'next','nextpagelink'=>__('继续阅读'),'previouspagelink'=>'') )?>
<?php ini_bdshare()?>
<?php if( get('ini_ad4') && get('ini_mad') ) echo "<div class=\"ad4\">".get('ini_ad4_code')."</div>"?>
			<div class="post-nav">
<?php
$prev_post = get_previous_post();
echo get_previous_post()? '				<p>上一篇：<a href="'.wp_get_shortlink( $prev_post->ID ).'">'.$prev_post->post_title.'</a></p>': ''?>
<?php $next_post = get_next_post();
echo get_next_post()? '				<p>下一篇：<a href="'.wp_get_shortlink( $next_post->ID ).'">'.$next_post->post_title.'</a></p>': '				<p>如果给等待加一个期限，你希望是多久...</p>';
?>
			</div>
<?php if( get('ini_mcopy') ){ echo feed_copyright(); }?>
<?php if( get('ini_mauthor') ){
?>
			<section class="author-info">
				<div class="m-t">本文小编</div>
				<a class="fn" href="<?php echo get_author_posts_url( $authordata->ID )?>" rel="external"><?php the_author('nickname')?></a><br>
				<p><?php echo the_author_meta( 'description' )?></p>
				<p>
<?php if( get_the_author_meta('org')!="" ){ ?>
					<span>公司: <?php the_author_meta('org')?>&nbsp;&nbsp;</span>
<?php } ?>
<?php if( get_the_author_meta('irole')!="" ){ ?>
					<span>职位: <?php the_author_meta('irole')?>&nbsp;&nbsp;</span>
<?php } ?>
<?php if( get_the_author_meta('addr')!="" ){ ?>
					<span>联系地址：<?php the_author_meta('addr')?>&nbsp;&nbsp;</span>
<?php } ?>
					邮箱: <a href="mailto:<?php the_author_email()?>" rel="external"><?php the_author_email()?>&nbsp;&nbsp;</a>
<?php if( get_the_author_meta('weibo')!="" ){ ?>
					<a href="<?php the_author_meta('weibo')?>" rel="external">新浪微博&nbsp;&nbsp;</a>
<?php } ?>
<?php if( get_the_author_meta('tweibo')!="" ){ ?>
					<a href="<?php the_author_meta('tweibo')?>" rel="external">腾讯微博</a>
<?php } ?>
				</p>
			</section>
<?php }?>
<?php include "related.php"?>
	</div><?#end content?>
<?php if('open'== $post->comment_status) comments_template()?>
<?php endwhile?>
<?php if(!get('ini_single')) get_sidebar()?>
<?php endif?>